import java.util.Arrays;

/**
 * Created by czz
 * Description:
 * User: 旧鹿麋
 * Date: 2021-08-29
 * Time: 21:17
 */
public class homework {
    public static void main(String[] args) {
        int[] arr={2,4,5,7,3};
        //avg(arr);//
        //sum(arr);//
        //System.out.println(Arrays.toString(transform(arr)));//
        //printArray(arr);//
        int[] arr3 = new int[100];
        for (int i = 1; i <= 100; i++) {
            arr3[i-1] = i;
        }
        printArray(arr3);

    }
    public static void printArray(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+"  ");
        }
    }
    public static int[] transform(int[] arr){
        for (int i = 0; i < arr.length; i++) {
             arr[i]*= 2;
        }
        return arr;
    }
    public static void sum(int[] arr) {
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        System.out.println("数组的和为："+sum);
    }
    public static void avg(int[] arr){
        int sum=0;
        double ret =1;
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        ret=(double) sum/(arr.length);
        System.out.println("平均值是："+ret);
    }

}
